<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	if(!confirm("<@s.m 'global.confirm.delete'/>")) {
		return;
	}
	var f = getTableForm();
	f.action="o_delete.do";
	f.submit();
}
function dc1(){
	var orderTimeStart= document.getElementById('orderTimeStart').value;
	var orderTimeEnd=document.getElementById('orderTimeEnd').value;
	if(orderTimeStart==""||orderTimeEnd==""){
		alert("请输入预约时间");
		return;
	}
	var f = getTableForm();
	f.action="v_exportExcel1.do?orderType=3&orderTimeStart="+orderTimeStart+"&orderTimeEnd="+orderTimeEnd;
	f.submit();
}
function dc2(){
	var orderTimeStart= document.getElementById('orderTimeStart').value;
	var orderTimeEnd=document.getElementById('orderTimeEnd').value;
	if(orderTimeStart==""||orderTimeEnd==""){
		alert("请输入预约时间");
		return;
	}
	var f = getTableForm();
	f.action="v_exportExcel2.do?orderType=1&orderTimeStart="+orderTimeStart+"&orderTimeEnd="+orderTimeEnd;
	f.submit();
}
</script>
</head>
<body>
<div class="box-positon">
	<div class="rpos"><@s.m "global.position"/>:  <@s.m "carOrder.function"/> - <@s.m "global.list"/></div>
	<form class="ropt">
	</form>
	<div class="clear"></div>
</div>
<div class="body-box">
<form action="v_list.do" method="post" style="padding-top:5px;">
<div>
用户名: <input type="text" name="userName" value="${userName!}" style="width:100px"/>
预约类型: <@p.select name="orderType" value=orderType list=listOrderType headerKey="" listKey="dicCode" listValue="dicName"  headerValue="cmsDictionary.type.allType"/>
状态: <@p.select name="status" value=status list=listOrderStatus headerKey="" listKey="dicCode" listValue="dicName"  headerValue="cmsDictionary.type.allType"/>
预约时间: <input type="text" name="orderTimeStart" id="orderTimeStart" value="${orderTimeStart!}" style="width:100px" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
至<input type="text" name="orderTimeEnd" id="orderTimeEnd" value="${orderTimeEnd!}" style="width:100px" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
<input class="query" type="submit" value="<@s.m "global.query"/>"/>
<input  type="button" value="导出预约试驾Excel" onclick="dc1();"/>
<input  type="button" value="导出预约保养维修Excel" onclick="dc2();"/>
</div>
</form>
<form id="tableForm" method="post">
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<@p.table value=pagination;carOrder,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='carOrder.id}'/><#t/>
	</@p.column><#t/>
	<@p.column code="用户">${(carOrder.user.name)!}</@p.column><#t/>
	<@p.column code="商家名称">${carOrder.shop.shopName!}</@p.column><#t/>
	<@p.column code="预约类型">${carOrder.orderTypeName!}</@p.column><#t/>
	<@p.column code="状态">${carOrder.statusName!}</@p.column><#t/>
	<@p.column code="联系人">${carOrder.username!}</@p.column><#t/>
	<@p.column code="车型名称(保养维修类型)">${carOrder.carType!}</@p.column><#t/>
	<@p.column code="预约日期">${carOrder.orderDate!}</@p.column><#t/>
	<@p.column code="预约时段">${carOrder.orderHour!}</@p.column><#t/>
	<!-- <@p.column code="到店时间">${carOrder.arriveTime!}</@p.column><#t/> -->
	<@p.column code="创建时间">${carOrder.createTime!}</@p.column><#t/>
	
	<@p.column code="global.operate" align="center">
	    <a href="v_view.do?id=${carOrder.id}&pageNo=${pageNo!}" class="pn-opt">查看</a> | <#rt/>
	     <#if -1!=carOrder.status!"">
		<a href="o_isQx.do?id=${carOrder.id}&pageNo=${pageNo!}" class="pn-opt">取消预约</a> | <#rt/>
		 </#if>
		 <#if -1==carOrder.status!"">
		 取消预约 | <#rt/>
		 </#if>
		 
	     <#if 0==carOrder.status!"">
		<a href="allotAdviers.do?id=${carOrder.id}&pageNo=${pageNo!}" class="pn-opt">确认</a> | <#rt/>
		 </#if>
		 <#if 0!=carOrder.status!"">
		 确认 | <#rt/>
		 </#if>
		 <#if 1==carOrder.status!"">
		<a href="o_isFinish.do?id=${carOrder.id}&pageNo=${pageNo!}" class="pn-opt">完成</a>  <#rt/>
		</#if>
		<#if 1!=carOrder.status!"">
		 完成 <#rt/>
		</#if>
		<!-- 
		<a href="o_delete.do?ids=${carOrder.id}&pageNo=${pageNo!}" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}" class="pn-opt"><@s.m "global.delete"/></a><#t/>
	 -->
	</@p.column><#t/>
</@p.table>
<div><input class="del-button" type="button" value="<@s.m "global.delete"/>" onclick="optDelete();"/></div>
</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>